<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.6.0.js"></script>
    <style>
        img{
            width: 200px;
            height: 186px;
            margin: 5px 5px;
            
        }
        .box{
            width: 640px;
            height: 400px;
            float: left;
            border: 1px solid white;
            position: absolute;
            top: 200px;
            left: 200px;
            
        }
        body{
            background-color: black;
        }
    </style>
</head>
<body>
    <div class="box">
            <img src="images/01.jpg" alt="">
            <img src="images/02.jpg" alt="">
            <img src="images/03.jpg" alt="">
            <img src="images/04.jpg" alt="">
            <img src="images/05.jpg" alt="">
            <img src="images/06.jpg" alt="">
    </div>
    <script>
        $(function(){
            $('.box>img').hover(function(){
                $(this).stop().animate({
                    opacity : '1'
                }).siblings().stop().animate({
                    opacity : '0.4'
                })
            },function(){
                $('.box > img').stop().animate({
                    opacity : '1'
                })
            })
        })
    </script>
</body>
</html>